﻿@model IEnumerable<SimpleForum.Data.Models.Notification>

<div id="notifications">
    @foreach (var Notification in Model) {
        <div class="top-notification" id="notification-@Notification.Id">@Notification.Message <span class="close">x</span></div>
    }
</div>

@Html.Resource(
    @<script type="text/javascript" language="javascript">
         $(document).ready(function () {
             $('#notifications .top-notification .close').click(function () {
                 $(this).parent().remove();
                 var id = $(this).parent().attr('id').split('-')[1];
                 $.post('/User/ReadNotification/', { id: id });
             });
         });
    </script>
, "js")